﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace IBasicsDal.BaseConstraint
{
    /// <summary>
    /// 基本更新约束
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public partial interface IBaseDal<T>
    {
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="entity"></param>
        /// <returns>返回受影响的行数</returns>
        public int Update(T entity);

        /// <summary>
        /// 更新(异步)
        /// </summary>
        /// <param name="entity"></param>
        /// <returns>返回受影响的行数</returns>
        public Task<int> UpdateAsync(T entity);

        /// <summary>
        /// 批量更新
        /// </summary>
        /// <param name="entities"></param>
        /// <returns>返回受影响的行数</returns>
        public int Update(List<T> entities);

        /// <summary>
        /// 批量更新(异步)
        /// </summary>
        /// <param name="entities"></param>
        /// <returns>返回受影响的行数</returns>
        public Task<int> UpdateAsync(List<T> entities);


    }
}
